package com.twu.biblioteca.view.console.ui_element;

import com.google.common.collect.Lists;

import com.twu.biblioteca.view.console.ConsoleViewController;

import java.util.List;

public abstract class Menu {
  private List<MenuItem> menuItemList = Lists.newArrayList();

  public void add(MenuItem menuItem) {
    menuItemList.add(menuItem);
  }

  public int size() {
    return menuItemList.size();
  }

  public MenuItem getMenuItem(int i) {
    return menuItemList.get(i - 1);
  }

  public abstract void select(ConsoleViewController viewController, int item);

  public List<MenuItem> getMenuItems() {
    return menuItemList;
  }
}
